﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<DataAccessLayer.Booking>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                ID
            </th>
            <th>
                BookingNumber
            </th>
            <th>
                GuestID
            </th>
            <th>
                BookingStatus
            </th>
            <th>
                CreatedByID
            </th>
            <th>
                CreatedOn
            </th>
            <th>
                ModifiedByID
            </th>
            <th>
                ModifiedOn
            </th>
            <th>
                FacilityID
            </th>
            <th>
                TotalPrice
            </th>
            <th>
                BookingDetailID
            </th>
            <th>
                StartDate
            </th>
            <th>
                EndDate
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.ID }) %> |
                <%: Html.ActionLink("Details", "Details", new { id=item.ID })%> |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.ID })%>
            </td>
            <td>
                <%: item.ID %>
            </td>
            <td>
                <%: item.BookingNumber %>
            </td>
            <td>
                <%: item.Guest.ID %>
            </td>
            <td>
                <%: item.BookingStatus %>
            </td>
            <td>
                <%: item.CreatedByID %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.CreatedOn) %>
            </td>
            <td>
                <%: item.ModifiedByID %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.ModifiedOn) %>
            </td>
            <td>
                <%: item.FacilityID %>
            </td>
            <td>
                <%: item.TotalPrice %>
            </td>
            <td>
                <%: item.BookingDetailID %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.StartDate) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.EndDate) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

